extract digits of a number